
<%--
  Created by IntelliJ IDEA.
  User: 逆阳
  Date: 2021/7/26
  Time: 15:04
  To change this template use File | Settings | File Template       Project StructureProject Structures.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page isELIgnored="false" %>
<%@ page import="java.util.List" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - Toastr通知</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico"> <link href="static/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="static/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="static/css/animate.min.css" rel="stylesheet">
    <link href="static/css/style.min.css?v=4.0.0" rel="stylesheet"><base target="_blank">
    <link href="static/css/plugins/toastr/toastr.min.css" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="row">
    <div class="col-lg-12">
        <div class="wrapper wrapper-content">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="row m-t-lg">
                            <div class="col-lg-12">
                                <div class="content-wrapper" style="min-height: 534px;">
                                    <!-- 内容头部 -->
                                    <section class="content-header">
                                        <h1>
                                            申报变更
                                        </h1>
                                        <ol class="breadcrumb">
                                            <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
                                            <li><a href="#">项目立项</a></li>
                                            <li class="active">申报变更</li>
                                        </ol>
                                    </section>
                                        <!-- 内容头部 /-->
                                        <!-- 正文区域 -->
                                        <form action="selectByID" id="project_selectByID" method="post">
                                        <section class="content">
                                            <div class="box box-primary">
                                                <div class="box-header with-border">
                                                    <h3 class="box-title">列表</h3>
                                                </div>
                                                <div class="box-body">
                                                    <!-- 数据表格 -->
                                                    <div class="table-box">
                                                        <!--数据列表-->
                                                        <table id="dataList" class="table table-bordered table-striped table-hover dataTable">
                                                            <thead id="aaa">
                                                            <tr>
<%--                                                                <th class="" style="padding-right:0px;">--%>
<%--                                                                    <input id="selall" type="checkbox" class="icheckbox_square-blue">--%>
<%--                                                                </th>--%>
                                                                <th style="display: none">id</th>
                                                                <th>项目名称</th>
                                                                <th>起始日期</th>
                                                                <th>终止日期</th>
                                                                <th>申报日期</th>
                                                                <th>实施单位</th>
                                                                <th>负责人</th>
                                                                <th>项目级次</th>
                                                                <th>项目类型</th>
                                                                <th>项目属性</th>
                                                                <th>项目申请理由</th>
                                                                <th>项目组主要成员</th>
                                                                <th>项目预算</th>
                                                                <th>申报状态</th>
                                                                <th class="text-center sorting">操作</th>
                                                            </tr>
                                                            </thead>
                                                            <tbody id="projectList"></tbody>
                                                            <div class="pull-left">
                                                                <div class="form-group form-inline">总共3页，共12条数据。每页4条
                                                                    <select class="form-control" id="changePageSize" onchange="changePageSize()">
                                                                        <option selected="selected">请选择</option>
                                                                        <option>1</option>
                                                                        <option>2</option>
                                                                        <option>3</option>
                                                                        <option>4</option>
                                                                        <option>5</option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                        </table>
                                                    </div>
                                                </div>
                                            </div>
                                        </section>
                                        </form>

                                        <form id="updateproject" action="updateProjectByID" method="post" style="display: none;position: absolute">
                                            <div class="a-1" style="top: 10px;left: 20px">项目名称</div>
                                            <input type="hidden" name="pid" class="aaa">
                                            <div class="b-1">
                                                <input type="text" class="c-1" name="pname" id="pname">
                                            </div>

                                            <div class="a-1"style="top: 10px;left: 20px">起始时间</div>
                                            <div class="b-1">
                                                <div class="input-group date">
                                                    <input type="date" class="c-1" id="psdate" autocomplete="off" name="psdate">
                                                </div>
                                            </div>

                                            <div class="a-1"style="top: 10px;left: 20px">终止时间</div>
                                            <div class="b-1">
                                                <div class="input-group date">
                                                    <input type="date" class="c-1" id="ptdate" autocomplete="off" name="ptdate">
                                                </div>
                                            </div>

                                            <div class="a-1"style="top: 10px;left: 20px">负责人</div>
                                            <div class="b-1">
                                                <input type="text" class="c-1" name="pdirector" id="pdirector" >
                                            </div>

                                            <div class="a-1"style="top: 10px;left: 20px">项目级次</div>
                                            <div class="b-1">
                                                <select class="form-control select2 select2-hidden-accessible" name="pgrade" tabindex="-1" aria-hidden="true">
                                                    <option value="一级" selected="selected">一级</option>
                                                    <option value="二级">二级</option>
                                                    <option value="三级">三级</option>
                                                </select>
                                                <span class="c1" dir="ltr" style="width: 306px;">
                                                    <span class="selection">
                                                        <span class="select2-selection select2-selection--single" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-labelledby="select2-itemLevel-zb-container">
                                                            <span class="select2-selection__rendered" id="select2-itemLevel-zb-container" title="一级"></span>
                                                            <span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>
                                                        </span>
                                                    </span>
                                                    <span class="dropdown-wrapper" aria-hidden="true"></span>
                                                </span>
                                            </div>

                                            <div class="a-1"style="top: 10px;left: 20px">项目类型</div>
                                            <div class=b-1">
                                                <select class="c-1" name="ptype" tabindex="-1" aria-hidden="true">
                                                    <option value="新材料" selected="selected">新材料</option>
                                                    <option value="电子信息">电子信息</option>
                                                    <option value="高技术服务">高技术服务</option>
                                                    <option value="资源与环境">资源与环境</option>
                                                    <option value="生物与新医药">生物与新医药</option>
                                                    <option value="新能源与节能">新能源与节能</option>
                                                    <option value="先进制造与自动化">先进制造与自动化</option>
                                                    <option value=""></option>
                                                </select>
                                                <span class="select2 select2-container select2-container--default" dir="ltr" style="width: 306px;">
                                                    <span class="selection">
                                                        <span class="select2-selection select2-selection--single" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-labelledby="select2-projectType-aw-container">
                                                            <span class="select2-selection__rendered" id="select2-projectType-aw-container" title="新材料"></span>
                                                            <span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>
                                                        </span>
                                                    </span>
                                                        <span class="dropdown-wrapper" aria-hidden="true"></span>
                                                </span>
                                            </div>

                                            <div class="a-1"style="top: 10px;left: 20px">项目属性</div>
                                            <div class="b-1">
                                                <select class="c-1" name="pattribute" tabindex="-1" aria-hidden="true">
                                                    <option value="一期" selected="selected">一期</option>
                                                    <option value="二期">二期</option>
                                                    <option value="三期">三期</option>
                                                </select>
                                                <span class="select2 select2-container select2-container--default" dir="ltr" style="width: 306px;">
                                                    <span class="selection">
                                                        <span class="select2-selection select2-selection--single" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-labelledby="select2-projectPro-a1-container">
                                                            <span class="select2-selection__rendered" id="select2-projectPro-a1-container" title="一期"></span>
                                                            <span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>
                                                        </span>
                                                    </span>
                                                    <span class="dropdown-wrapper" aria-hidden="true"></span>
                                                </span>
                                            </div>

                                            <div class="a-1" style="top: 10px;left: 20px">项目申请理由</div>
                                            <div class="b-1x">
                                                <textarea class="c-1" rows="3" placeholder="项目申请理由" id="preson" name="preson" ></textarea>
                                            </div>

                                            <div class="a-1"style="top: 10px;left: 20px">项目组主要成员</div>
                                            <div class="b-1">
                                                <input type="text" class="c-1" name="pperson" id="pperson">
                                            </div>

                                            <div class="a-1"style="top: 10px;left: 20px">项目预算</div>
                                            <div class="b-1">
                                                <input type="text" class="c-1" name="pbudget" id="pbudget">
                                            </div>

                                            <div class="box-tools text-center">
                                                <button type="submit" class="btn bg-maroon" onclick="hidden()">更新</button>
                                                <button type="button" class="btn bg-default" onclick="history.back(-1);">返回</button>
                                            </div>
                                        </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="static/js/jquery.min.js?v=2.1.4"></script>
<script src="static/js/bootstrap.min.js?v=3.3.5"></script>
<script src="static/js/content.min.js?v=1.0.0"></script>
<script src="static/js/plugins/toastr/toastr.min.js"></script>
<script type="text/javascript">
    $(function(){var i=-1;var toastCount=0;var $toastlast;var getMessage=function(){var msg="Hi, welcome to Inspinia. This is example of Toastr notification box.";return msg};$("#showsimple").click(function(){toastr.success("Without any options","Simple notification!")});$("#showtoast").click(function(){var shortCutFunction=$("#toastTypeGroup input:radio:checked").val();var msg=$("#message").val();var title=$("#title").val()||"";var $showDuration=$("#showDuration");var $hideDuration=$("#hideDuration");var $timeOut=$("#timeOut");var $extendedTimeOut=$("#extendedTimeOut");var $showEasing=$("#showEasing");var $hideEasing=$("#hideEasing");var $showMethod=$("#showMethod");var $hideMethod=$("#hideMethod");var toastIndex=toastCount++;toastr.options={closeButton:$("#closeButton").prop("checked"),debug:$("#debugInfo").prop("checked"),progressBar:$("#progressBar").prop("checked"),positionClass:$("#positionGroup input:radio:checked").val()||"toast-top-right",onclick:null};if($("#addBehaviorOnToastClick").prop("checked")){toastr.options.onclick=function(){alert("You can perform some custom action after a toast goes away")}}if($showDuration.val().length){toastr.options.showDuration=$showDuration.val()}if($hideDuration.val().length){toastr.options.hideDuration=$hideDuration.val()}if($timeOut.val().length){toastr.options.timeOut=$timeOut.val()}if($extendedTimeOut.val().length){toastr.options.extendedTimeOut=$extendedTimeOut.val()}if($showEasing.val().length){toastr.options.showEasing=$showEasing.val()}if($hideEasing.val().length){toastr.options.hideEasing=$hideEasing.val()}if($showMethod.val().length){toastr.options.showMethod=$showMethod.val()}if($hideMethod.val().length){toastr.options.hideMethod=$hideMethod.val()}if(!msg){msg=getMessage()}$("#toastrOptions").text("Command: toastr["+shortCutFunction+']("'+msg+(title?'", "'+title:"")+'")\n\ntoastr.options = '+JSON.stringify(toastr.options,null,2));var $toast=toastr[shortCutFunction](msg,title);$toastlast=$toast;if($toast.find("#okBtn").length){$toast.delegate("#okBtn","click",function(){alert("you clicked me. i was toast #"+toastIndex+". goodbye!");$toast.remove()})}if($toast.find("#surpriseBtn").length){$toast.delegate("#surpriseBtn","click",function(){alert("Surprise! you clicked me. i was toast #"+toastIndex+". You could perform an action here.")})}});function getLastToast(){return $toastlast}$("#clearlasttoast").click(function(){toastr.clear(getLastToast())});$("#cleartoasts").click(function(){toastr.clear()})});
</script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
<script>
    $(function(){
    $.ajax({
        url:"findAll",
        type: "post",
        dataType:"json",
        success:function(data){
            for (let i = 0; i < data.length; i++) {
                $("#projectList").append("<tr>" +
                    "<td style='display: none' id='proupdate'>"+data[i].pid+"</td>"+
                    " <td>"+data[i].pname+"</td> " +
                    "<td>"+data[i].psdate+"</td> " +
                    "<td>"+data[i].ptdate+"</td>" +
                    " <td>"+data[i].pddate+"</td> " +
                    "<td>"+data[i].piunit+"</td> " +
                    "<td>"+data[i].pdirector+"</td> " +
                    "<td>"+data[i].pgrade+"</td> " +
                    "<td>"+data[i].ptype+"</td> " +
                    "<td>"+data[i].pattribute+"</td> " +
                    "<td>"+data[i].preson+"</td> " +
                    "<td>"+data[i].pperson+"</td> " +
                    "<td>"+data[i].pbudget+"</td>" +
                    "<td>代受理</td>" +
                    "<td class='text-center'><input id='updates' type='button' class='btn bg-olive btn-xs' onclick='show()' value='申报变更' ></a></td></tr>")
            }
            $("#updates").click(function (){
               let text = $(this).parents().find("#proupdate").text();
               $(".aaa").val(text);
            });
        },
        error:function (){
            alert("zz")
        }
    })
    });

    // $(function (){
    //     $.ajax({
    //        url:"deleteproject",
    //         type: "post",
    //         dataType: "json",
    //         success:function (data){
    //             alert("删除成功...")
    //         }
    //     });
    // });

    function show(){
        var updateproject=document.getElementById("updateproject");
        updateproject.style.display="block";

        var project_selectByID=document.getElementById("project_selectByID");
        project_selectByID.style.display="none";
    }

    function hidden(){
        var dataList=document.getElementById("dataList");
        dataList.style.display="none";
    }



</script>


</body>

</html>
